<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <jsp:include page="WEB-INF/head.jsp"></jsp:include>

    <title>登录</title>
    <script type="text/javascript">
        function changeCode() {
            document.getElementById("img").src = "${pageContext.request.contextPath}/checkcode?r=" + new Date().getTime();
        }
    </script>
</head>
<body>

<!--布局方式-->
<div class="container-fluid" style="width: 40%">
    <!--行-->
    <div class="row">
        <form method="get" action="./contactServlet">
            <div class="form-group has-success">
                <label class="control-label" for="username">姓名</label>
                <input type="text" class="form-control" id="username" name="username" value="${user.username}">
            </div>
            <div class="form-group has-warning">
                <label class="control-label" for="password">密码</label>
                <input type="password" class="form-control" id="password" name="password" value="${user.password}">
            </div>
            <div class="form-group has-error">
                <label class="control-label" for="code">验证码</label>
                <input type="text" class="form-control" id="code" name="code">
            </div>
            <div class="row">
                <div class="col-sm-6 text-center">
                    <img class="img-thumbnail text-center" id="img" onclick="changeCode();"
                         name="img" src="${pageContext.request.contextPath}/checkcode">
                </div>
                <div class="col-sm-6 text-center">
                    <span class="btn btn-success " href="javascript:;" onclick="changeCode();">换一换</span>
                </div>
            </div>

            <div class="row">
                <div class="col-md-6">
                    <button type="reset" class="btn btn-default btn-group-justified">重置</button>
                </div>
                <div class="col-md-6">
                    <button type="submit" class="btn btn-primary btn-group-justified">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<jsp:include page="WEB-INF/footer.jsp"></jsp:include>
</body>
</html>